/* Copyright (C) 2010 Fredrique Samuels, fredriquesamuels@gmail.com */

/*
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef TRI_EXT_LABEL_H_
#define TRI_EXT_LABEL_H_

#include <iostream>
#include <vector>
#include <string>
#include <map>

//Include library header
#include "component.h"
#include "../text.h"
#include "common.h"
#include "../base/utils.h"

namespace tri {
namespace ui {


//======================================================================

/**
 * Component class used for user interface
 */
class extLabel : public tri::ui::extComponent {
public:
	extLabel();
	virtual ~extLabel();
				
	/**
	 * Display Component
	 */
	virtual void display();
	
	void setFontSize(int s);
	void setCharacterHeight(float h);
	void setFont(std::string font);
	void setText(const char* fmt,...);
	void setText(std::string);
	void setTextColor(int r, int g, int b, int a);
	void setTextTargetColor(int r, int g, int b, int a,float t = 1.0);
	void setTextBackGroundColor(int r, int g, int b, int a);
	void setTextAlignment(int alignment);
	std::string getText();
	void setFitToTextWidth(bool b);
	
	virtual void update();
	
	//virtual bool updateStyle();
	virtual void applyStyle(int state);
	
private:
	tri::TText mText;
	int mTextAlignment;
	bool mFitToTextWidth;
};

}
}

#endif
